<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('销售详情列表')" />
  <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="gray-bg">
	<div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="logininfor-form">
					<div class="select-list">
						<ul>
              <li>
                <label shiro:hasPermission="admin">部门：</label><select type="text" name="部门" th:with="type=${@dict.getDept()}" shiro:hasPermission="admin">
                <option value="">所有</option>
                <option th:each="dict : ${type}" th:text="${dict.getDeptName()}" th:value="${dict.getDeptName()}"></option>
              </select>
              </li>
<!--							<li>-->
<!--								<label>部门：</label><input type="text" name="部门"/>-->
<!--							</li>-->
							<li>
								<label>客商名称：</label><input type="text" name="客商名称"/>
							</li>
							<li>
								<label>业务员：</label><input type="text" name="业务员"/>
							</li>
<!--							<li>-->
<!--								<label>登录状态：</label><select name="status" th:with="type=${@dict.getType('sys_common_status')}">-->
<!--									<option value="">所有</option>-->
<!--									<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>-->
<!--								</select>-->
<!--							</li>-->
							<li class="select-time">
								<label>原单审核日期： </label>

                  <input type="text" class="form-control" id="laydate-demo-3" placeholder="开始时间" name="params[beginTime]" >

<!--								<input type="text" class="form-control" id="startTime" placeholder="开始时间" name="params[beginTime]">-->
<!--								<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>-->
								<span>-</span>

                  <input type="text" class="form-control" id="laydate-demo-4" placeholder="结束时间" name="params[endTime]" >
<!--								<input type="text" class="form-control" id="endTime" placeholder="结束时间" name="params[endTime]">-->
<!--								<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>-->

							</li>
							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="query()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>

<!--			<div class="btn-group-sm" id="toolbar" role="group">-->
<!--				<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="monitor:logininfor:remove">-->
<!--		            <i class="fa fa-remove"></i> 删除-->
<!--		        </a>-->
<!--		        <a class="btn btn-danger" onclick="$.operate.clean()" shiro:hasPermission="monitor:logininfor:remove">-->
<!--	                <i class="fa fa-trash"></i> 清空-->
<!--	            </a>-->
<!--	            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="monitor:logininfor:export">-->
<!--		            <i class="fa fa-download"></i> 导出-->
<!--		        </a>-->
<!--	        </div>-->

	        <div class="col-sm-12 select-table table-striped">
			    <table id="bootstrap-table1" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>

	<th:block th:include="include :: footer" />
  <th:block th:include="include :: datetimepicker-js" />
	<script th:inline="javascript">
	    var datas = [[${@dict.getType('sys_common_status')}]];
		var prefix = ctx + "sale/aixs";

		$(function() {

      <!-- laydate示例 -->
      layui.use('laydate', function(){
        var laydate = layui.laydate;
        laydate.render({
          elem: '#laydate-demo-3',
          type: 'datetime',
          trigger: 'click'
        });
        laydate.render({
          elem: '#laydate-demo-4',
          type: 'datetime',
          trigger: 'click'
        });
      })

      $("#datetimepicker-demo-3").datetimepicker({
        format: "yyyy-mm-dd hh:ii:ss",
        autoclose: true
      });

      $("#datetimepicker-demo-4").datetimepicker({
        format: "yyyy-mm-dd hh:ii:ss",
        autoclose: true
      });
    })

      function query() {
        var options = {
          id: "bootstrap-table1",
          url: prefix + "/list",
          cleanUrl: prefix + "/clean",
          removeUrl: prefix + "/remove",
          exportUrl: prefix + "/export",
          sortName: "原单审核日期",
          sortOrder: "desc",
          modalName: "销售详情",
          escape: true,
          showPageGo: true,
          rememberSelected: true,
          showFooter: true
          ,
          columns: [{
            field: 'state',
            checkbox: true
          },
            {
              field: '部门',
              title: '部门'
            },
            {
              field: '业务员',
              title: '业务员',
              sortable: true
            },
            {
              field: '客商名称',
              title: '客商名称'
            },
            {
              field: '药品名称',
              title: '药品名称'
            },
            {
              field: '数量',
              title: '数量'
            },

            {
              field: '销售金额',
              title: '销售金额'

            },
            {

              ignore: true,
              rowspan: 0,
              colspan: 0,
              cardVisible: false
              ,
              footerFormatter: function (value) {
                var sumBalance = 0;
                for (var i in value) {
                  sumBalance = parseFloat(value[0].allPrice);
                }
                return "总金额：" + sumBalance;
              }
            },
            {
              field: '原单审核日期',
              title: '原单审核日期',
              sortable: true
            }

            // ,
            // {
            //     field: 'status',
            //     title: '登录状态',
            //     align: 'center',
            //     formatter: function(value, row, index) {
            //     	return $.table.selectDictLabel(datas, value);
            //     }
            // },
            // {
            //     field: 'msg',
            //     title: '操作信息'
            // },
            // {
            //     field: 'loginTime',
            //     title: '登录时间',
            //     sortable: true
            // }
          ]
        };
        $.table.init(options);
      }

      function reset() {
        var id = "bootstrap-table1"
        $.table.destroy(id);
      }
	</script>
</body>
</html>
